package cn.bdqn.xtxg.oof;

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Dog dog = new Dog(100,20);
		Penguin pen = new Penguin(100,80);
		Master mas = new Master();
		System.out.println("欢迎来到宠物商店!");
		System.out.println("请输入宠物的名字:");
		String name = sc.next();
		System.out.println("请输入您想要的宠物（1.狗狗2.企鹅）");
		int num = sc.nextInt();
		int nums;
		dog.setName(name);
		if(num==1) {
			System.out.println("请输入狗狗的品种（1.聪明的金毛2.酷酷的二哈）");
			nums =sc.nextInt();
			if(nums == 1) {
				dog.setStrain("聪明的金毛");
				System.out.println("请问主人要给宠物喂食吗?(yes/no)");
				String eat = sc.next();
				if(eat.equals("yes")) {
					mas.food(dog);
					System.out.println("主人要陪宠物一起玩耍吗(yes/no)");
					String ply = sc.next();
					if(ply.equals("yes")) {
						mas.Play(dog);
					}
					} else {
						System.out.println("好吧 看来主人还不愿意给宠物吃食物呢！");
						System.out.println("主人要陪宠物一起玩耍吗(yes/no)");
						String ply = sc.next();
						if(ply.equals("yes")) {
							mas.Play(dog);
							
						}
					}
			} else {
				dog.setStrain("酷酷的二哈");
				System.out.println("请问主人要给宠物喂食吗?(yes/no)");
				String eat = sc.next();
				if(eat.equals("yes")) {
					mas.food(dog);
					System.out.println("主人要陪宠物一起玩耍吗(yes/no)");
					String ply = sc.next();
					if(ply.equals("yes")) {
						mas.Play(dog);
						
					}
					} else {
						System.out.println("好吧 看来主人还不愿意给宠物吃食物呢！");
						System.out.println("主人要陪宠物一起玩耍吗(yes/no)");
						String ply = sc.next();
						if(ply.equals("yes")) {
							mas.Play(dog);
						}
					}
			}
			//dog.print();
			
			dog.print();
		} else {
			pen.setName(name);
			System.out.println("请输入企鹅的(1.Q仔2.Q妹)");
			nums = sc.nextInt();
			if(nums == 1) {
				pen.setSex(pen.getMALE());
				System.out.println("请问主人要给宠物喂食吗?(yes/no)");
				String eat = sc.next();
				if(eat.equals("yes")) {
					mas.food(pen);
					System.out.println("主人要陪宠物一起玩耍吗(yes/no)");
					String ply = sc.next();
					if(ply.equals("yes")) {
						mas.Play(pen);
						
					}
				}else {
					System.out.println("好吧 看来主人还不愿意给宠物吃食物呢！");
					System.out.println("主人要陪宠物一起玩耍吗(yes/no)");
					String plys = sc.next();
					if(plys.equals("yes")) {
						mas.Play(pen);
					}
				}
			} else {
				pen.setSex(pen.getFEMALE());
				System.out.println("请问主人要给宠物喂食吗?(yes/no)");
				String eat = sc.next();
				if(eat.equals("yes")) {
					mas.food(pen);
					System.out.println("主人要陪宠物一起玩耍吗(yes/no)");
					String ply = sc.next();
					if(ply.equals("yes")) {
						mas.Play(pen);
						
					}
				}else {
					System.out.println("好吧 看来主人还不愿意给宠物吃食物呢！");
					System.out.println("主人要陪宠物一起玩耍吗(yes/no)");
					String plys = sc.next();
					if(plys.equals("yes")) {
						mas.Play(pen);
					}
				}
			}
			pen.print();
		}
	}

}
